home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / QuickDraw GX / QuickDraw GX Info / QuickDraw GX Interfaces / Interfaces & Libraries / interfaces / graphics toolbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-30  |  5.0 KB  |  121 lines  |  [TEXT/MPS ]

  1. /* graphics:
  2.     toolbox interfaces
  3.     by Cary Clark, Georgiann Delaney, Herb Derby, Michael Fairman, Pablo Fernicola, Dave Good, Josh Horwich, Barton House, Robert Johnson, Keith McGreggor, Mike Reed, Oliver Steele, David Van Brink, Chris Yerga
  4.     Copyright 1987 - 1994 Apple Computer, Inc.  All rights reserved.    */
  5.  
  6. #pragma once
  7.  
  8. #ifndef graphicsToolboxIncludes
  9.     #define graphicsToolboxIncludes
  10.  
  11.     #ifndef __WINDOWS__
  12.         #include <Windows.h>
  13.     #endif
  14.  
  15.     #ifndef fontTypesIncludes
  16.         #include "font types.h"
  17.     #endif
  18.  
  19.     #ifndef graphicsTypesIncludes
  20.         #include "graphics types.h"
  21.     #endif
  22.  
  23.     #ifndef graphicsLinkageIncludes
  24.         #include "graphics linkage.h"
  25.     #endif
  26.  
  27.     /* QD to QD GX Translator typedefs */
  28.     enum gxTranslationOptions {
  29.         gxDefaultOptionsTranslation        = 0x0000,
  30.         gxOptimizedTranslation            = 0x0001,
  31.         gxReplaceLineWidthTranslation        = 0x0002,
  32.         gxSimpleScalingTranslation        = 0x0004,
  33.         gxSimpleGeometryTranslation        = 0x0008,    /* implies simple scaling */
  34.         gxSimpleLinesTranslation            = 0x000C,    /* implies simple geometry & scaling */
  35.         gxLayoutTextTranslation            = 0x0010,    /* turn on gxLine layout (normally off) */
  36.         gxRasterTargetTranslation        = 0x0020,
  37.         gxPostScriptTargetTranslation        = 0x0040,
  38.         gxVectorTargetTranslation        = 0x0080
  39.     };
  40.     typedef long gxTranslationOption;
  41.  
  42.     enum gxTranslationStatistics {
  43.         gxContainsFormsBegin            = 0x0001,
  44.         gxContainsFormsEnd                = 0x0002,
  45.         gxContainsPostScript            = 0x0004,
  46.         gxContainsEmptyPostScript        = 0x0008
  47.     };
  48.     typedef long gxTranslationStatistic;
  49.  
  50.     #define    gxQuickDrawPictTag        0x70696374    /* 'pict' */
  51.  
  52.     struct gxQuickDrawPict {
  53.         /* translator inputs */
  54.         gxTranslationOption        options;
  55.         Rect                    srcRect;
  56.         Point                    styleStretch;
  57.  
  58.         /* size of quickdraw picture data */
  59.         unsigned long            dataLength;
  60.  
  61.         /* file alias */
  62.         struct gxBitmapDataSourceAlias    alias;        
  63.     };
  64.  
  65.     #ifndef __cplusplus
  66.         typedef struct gxQuickDrawPict gxQuickDrawPict;
  67.     #endif
  68.  
  69.     #pragma procname gxShapeSpool
  70.     typedef OSErr (*gxShapeSpoolProcPtr)(gxShape toSpool, long refCon);
  71.     typedef gxShapeSpoolProcPtr gxShapeSpoolFunction;
  72.  
  73.     /* printing utilities typedef */
  74.     #pragma procname gxUserViewPortFilter
  75.     typedef void (*gxUserViewPortFilterProcPtr)(gxShape toFilter, gxViewPort portOrder, long refCon);
  76.     typedef gxUserViewPortFilterProcPtr gxUserViewPortFilter;
  77.  
  78.     #pragma procname gxConvertQDFont
  79.     typedef long (*gxConvertQDFontProcPtr)(gxStyle dst, long txFont, long txFace);
  80.     typedef gxConvertQDFontProcPtr gxConvertQDFontFunction;
  81.  
  82.     #ifdef __cplusplus
  83.     extern "C" {
  84.     #endif
  85.  
  86.     /* WindowRecord utilities */
  87.     gxViewPort GXNewWindowViewPort(WindowPtr qdWindow) GXInlineCode(0x236, gxNeedClient|gxNeedHeap|gxNeedStack);
  88.     gxViewPort GXGetWindowViewPort(WindowPtr qdWindow) GXInlineCode(0x237, gxNeedClient|gxNeedHeap|gxNeedStack);
  89.     WindowPtr GXGetViewPortWindow(gxViewPort portOrder) GXInlineCode(0x238, gxNeedClient|gxNeedHeap|gxNeedStack);
  90.  
  91.     /* GDevice utilities */
  92.     GDHandle GXGetViewDeviceGDevice(gxViewDevice theDevice) GXInlineCode(0x239, gxNeedClient|gxNeedHeap|gxNeedStack);
  93.     gxViewDevice GXGetGDeviceViewDevice(GDHandle qdGDevice) GXInlineCode(0x23a, gxNeedClient|gxNeedHeap|gxNeedStack);
  94.  
  95.     /* gxPoint utilities */
  96.     void GXConvertQDPoint(const Point *shortPt, gxViewPort portOrder, gxPoint *fixedPt) GXInlineCode(0x23b, gxNeedClient|gxNeedHeap|gxNeedStack);
  97.  
  98.     /* mouse utilities */
  99.     void GXGetGlobalMouse(gxPoint *globalPt) GXInlineCode(0x23c, gxNeedClient|gxNeedHeap|gxNeedStack);                    /* return mouse location in fixed-gxPoint global space */
  100.     void GXGetViewPortMouse(gxViewPort portOrder, gxPoint *localPt) GXInlineCode(0x23d, gxNeedClient|gxNeedHeap|gxNeedStack);        /* return fixed-gxPoint local mouse (gxViewPort == 0 --> default) */
  101.  
  102.     /* printing utilities */
  103.     gxUserViewPortFilter GXGetViewPortFilter(gxViewPort portOrder, long *refCon) GXInlineCode(0x25e, gxNeedClient|gxNeedHeap|gxNeedStack);
  104.     void GXSetViewPortFilter(gxViewPort portOrder, gxUserViewPortFilter filter, long refCon) GXInlineCode(0x23e, gxNeedClient|gxNeedHeap|gxNeedStack);
  105.  
  106.     /* QD to QD GX Translator functions */
  107.     void GXInstallQDTranslator(GrafPtr port, gxTranslationOption options, const Rect *srcRect, const Rect *dstRect, Point styleStrech, gxShapeSpoolFunction userFunction, void *reference) GXInlineCode(0x23f, gxNeedClient|gxNeedHeap|gxNeedStack);
  108.     gxTranslationStatistic GXRemoveQDTranslator(GrafPtr port, gxTranslationStatistic *statistic) GXInlineCode(0x240, gxNeedClient|gxNeedHeap|gxNeedStack);
  109.     gxShape GXConvertPICTToShape(const PicHandle pict, gxTranslationOption options, const Rect *srcRect, const Rect *dstRect, Point styleStretch, gxShape destination, gxTranslationStatistic *stats) GXInlineCode(0x241, gxNeedClient|gxNeedHeap|gxNeedStack);
  110.  
  111.     /* Find the best GX style given a QD font and face. Called by the QD->GX translator */
  112.     long GXConvertQDFont(gxStyle theStyle, long txFont, long txFace) GXInlineCode(0x242, gxNeedClient|gxNeedHeap|gxNeedStack);
  113.     gxConvertQDFontProcPtr GXGetConvertQDFont(void) GXInlineCode(0x243, gxAnyContext);
  114.     void GXSetConvertQDFont(gxConvertQDFontProcPtr userFunction) GXInlineCode(0x244, gxAnyContext);
  115.  
  116.     #ifdef __cplusplus
  117.     }
  118.     #endif
  119.  
  120. #endif
  121.